import { type HttpHandler, HttpResponse, http } from 'msw'

export const handlers: HttpHandler[] = [
  http.post('/mock/auth/login', async () => {
    return HttpResponse.json({
      code: 200,
      msg: '操作成功',
      data: {
        access_token:
          'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJWd2N1NFlwT1VNWUdqYW9UZHdrMUdrQ2szQTlVNU9VSiJ9.JZ41Ceylx8oDmrk4zvJsPfTJi_zne3JQoE5FGOFHa3A',
      },
    })
  }),
  http.get('/mock/code', async () => {
    return HttpResponse.json({
      code: 200,
      msg: '操作成功',
      data: {
        captchaEnabled: false,
      },
    })
  }),
]
